import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Index from '@/blog/Index'

Vue.use(Router);

export default new Router({
  routes: [
    {
      /**
       * 社区
       */
      path: '/Community',
      name: 'Community',
      // component: () => import('../blog/ShowBlog.vue')
      component: resolve => require(['../blog/Community.vue'], resolve)//按需加载
  },
    {
      path: '/',
      name: 'Index',
      // component: resolve => require(['../blog/Index.vue'], resolve)//按需加载
      component: Index,
        //返回不刷新
        // meta:{
        //   keepAlive:true
        // }
    },
    {
      /**
       * 展示
       */
      path: '/ShowBlog',
      name: 'ShowBlog',
      // component: () => import('../blog/ShowBlog.vue')
      component: resolve => require(['../blog/ShowBlog.vue'], resolve)//按需加载
    },
    {
      /**
       * 编辑
       */
      path: '/EditBlog',
      name: 'EditBlog',
      // component: () => import('../blog/EditBlog.vue')
      component:  resolve => require(['../blog/EditBlog.vue'], resolve)//按需加载
    },
    {
      /**
       * 登录注册
       */
      path: '/UserLogRegi',
      name: 'UserLogRegi',
      // component: () => import('../blog/EditBlog.vue')
      component:  resolve => require(['../user/UserLogRegi.vue'], resolve)//按需加载
    },{
      /**
       * 重置密码
       */
      path: '/ResetPassword',
      name: 'ResetPassword',
      // component: () => import('../blog/EditBlog.vue')
      component:  resolve => require(['../user/ResetPassword.vue'], resolve)//按需加载
    },{
      /**
       * 修改密码
       */
      path: '/UpdatePass',
      name: 'UpdatePass',
      // component: () => import('../blog/EditBlog.vue')
      component:  resolve => require(['../user/UpdatePass.vue'], resolve)//按需加载
    },
  ]
})
